home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / TFC029.422 < prev    next >
Text File  |  1993-03-20  |  4KB  |  126 lines

  1. 2TFC029.MOD 1Simple Time Bank for WWIV 4.22
  2. The Flying Chicken [SysOp] #1 @12456
  3. 3Friday, March 19, 1993  1 6:01 pm
  4. TFC029.MOD - Simple Time Bank for WWIV 4.22
  5. Author : The Flying Chicken
  6. Address: 1@12456 (WWIVLink) 1@2456 (WWIVNet) 1@2456 (IceNet)
  7. Source : WWIV 4.22
  8. Version: 1.0
  9.  
  10.     When Wayne increased the size of the userrec in WWIV 4.22,
  11.     he added a new variable called banktime.  This mod simply
  12.     makes use of that variable.  It allows users to store time
  13.     in a "bank" to use when they have the need for extra
  14.     on-line time (big tranfers and such).
  15.  
  16.  
  17.     Before using this or any mod, back up your source !!!!!
  18.  
  19.                 PKZIP source *.c *.h *.mak
  20.  
  21.     If you mess something up later and want to unstall the mod,
  22.     just type:
  23.  
  24.                 PKUNZIP source -o
  25.  
  26.  
  27.     1. Open up BBS.C.  Search for mainmenu() and make the changes
  28.        shown.
  29.  
  30.   if (strcmp(s,"CLS")==0)
  31.     outstr("\f");
  32.   if ((strcmp(s,"BANK")==0) && (actsl>40)) {            /* ADD */
  33.     time_bank();                                        /* ADD */
  34.   }
  35.  
  36.  
  37.     2. Save BBS.C, and load up UTILITY.C.  Add the following
  38.        function the end of the file.
  39.  
  40. void time_bank(void)
  41. {
  42.   int mins,done,left;
  43.   char ch,s[81];
  44.  
  45.   done=0;
  46.   do {
  47.     nl();
  48.     npr("2Welcome to %s's Time Bank\r\n",syscfg.systemname);0
  49.     nl();
  50.     pl("21)1 3Deposit Time");0
  51.     pl("22) 3Withdraw Time");0
  52.     nl();
  53.     pl("2Q) 3Quit");0
  54.     nl();
  55.     left=((int)(nsl()/60))-1;
  56.     npr("7You currenlty have %d minutes left for this call.\r\n",left);0
  57.     npr("7You currently have %d minutes stored in the bank.\r\n",0
  58.       thisuser.banktime);
  59.     prt(2,"Your selection? ");
  60.     ch=onek("Q12");
  61.     switch (ch) {
  62.       case 'Q':
  63.         done=1;
  64.         break;
  65.       case '1':
  66.         nl();
  67.         prt(2,"Deposit how many minutes? ");
  68.         input(s,4);
  69.         if (s[0]) {
  70.           mins=atoi(s);
  71.           if (mins) {
  72.             if (mins>left) {
  73.               prt(6,"You don't have that much time left!");
  74.               nl();
  75.             } else {
  76.               thisuser.banktime+=mins;
  77.               thisuser.extratime-=(double)(mins * 60);
  78.               write_user(usernum,&thisuser);
  79.               prt(6,"Deposited.");
  80.               nl();
  81.             }
  82.           }
  83.         }
  84.         break;
  85.       case '2':
  86.         nl();
  87.         prt(2,"Withdraw how many minutes? ");
  88.         input(s,4);
  89.         if (s[0]) {
  90.           mins=atoi(s);
  91.           if (mins) {
  92.             if (mins>thisuser.banktime) {
  93.               prt(6,"You don't have that much time in the bank!");
  94.               nl();
  95.             } else {
  96.               thisuser.banktime-=mins;
  97.               thisuser.extratime+=(double)(mins * 60);
  98.               write_user(usernum,&thisuser);
  99.               prt(6,"Withdrawn.");
  100.               nl();
  101.             }
  102.           }
  103.         }
  104.         break;
  105.     }
  106.   } while (!done);
  107.   nl();
  108. }
  109.  
  110.  
  111.     3. Now, save UTILITY.C and type MAKE FCNS to load the function
  112.        header.  If you can't do a MAKE FCNS, get my TFC026 mod,
  113.        QUICK!.  Until you get the mod, add the following line to
  114.        FCNS.H after the comment that reads /* File: utility.c */.
  115.  
  116. void time_bank(void);                   /* ADD */
  117.  
  118.  
  119.  
  120.     DISCLAIMER:  I make no guarantees with this mod whatsoever.
  121.     Your installation of the mod is your acceptance of any
  122.     damages caused to your hardware or software, incendental or
  123.     otherwise.
  124.  
  125. 2    PLEASE REPORT ANY BUGS!0
  126.